﻿using TaskManager.Control;

namespace TaskManager.Event
{
    public enum TaskEventArgsType
    {
        Undeterminated,
        Started,
        Updated,
        Ended,
        Progressed,
        Renamed,
        Completed,
        Faulted,
        Canceled,
        Cleared,
        ClearedAll
    }

    public class TaskEventArgs
    {
        public TaskEventArgsType Type { get; private set; }
        public TaskViewModel Task { get; private set; }
        public string TaskId { get; private set; }
        public string Text { get; private set; }
        public int Count { get; private set; }

        public TaskEventArgs(TaskEventArgsType type)
        {
            Type = type;
        }

        public TaskEventArgs(TaskEventArgsType type, TaskViewModel task)
        {
            Type = type;
            Task = task;
        }

        public TaskEventArgs(TaskEventArgsType type, string id)
        {
            Type = type;
            TaskId = id;
        }

        public TaskEventArgs(TaskEventArgsType type, string id, string text)
        {
            Type = type;
            TaskId = id;
            Text = text;
        }

        public TaskEventArgs(TaskEventArgsType type, string id, int percent)
        {
            Type = type;
            TaskId = id;
            Count = percent;
        }
    }
}
